<%--
  Created by IntelliJ IDEA.
  User: poo
  Date: 2021/3/21
  Time: 0:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>
    <%--${pageContext.request.contextPath}获取web包下的相对路径--%>
    <script src="${pageContext.request.contextPath}/static/js/jquery-3.6.0.js"></script>
    <script>
      function a1(){
        $.post({
          /*访问的请求路径*/
          url:"${pageContext.request.contextPath}/a1",
          /*访问带有的参数*/
          data:{'name':$("#txtName").val()},
          /*回调成功后做的事*/
          success:function (data,status) {
            alert(data);
            alert(status);
          }
        });
      }
    </script>
  </head>
  <body>
    <%--失去焦点的时候，发起一个请求给后台--%>
    <input type="text" id="txtName" onblur="a1()">
  </body>
</html>
